/*
 * @LastEditors: yuSeen
 * @LastEditTime: 2021-11-19 10:28:36
 * 天凉好个秋
 */

/**
 * @description: 结构化分页请求返回的数据
 * @param {any} data    数据结果
 * @param {number} currentPage  当前所处页码
 * @param {number} total    结果总条数
 * @param {number} limit    每页条数
 * @return {*}
 */
const pagination = (data: any = [], currentPage: number = 1, total: number = 0, limit: number = 10) => {
    return {
        itemList: data,
        currentPage,
        limit,
        total,
        totalPage: Math.ceil(total / limit)
    }
}

export default pagination